import { createApp } from "vue";
import App from "./App.vue";

// 如果路径是以文件夹结束的，相当于引入了它下面的index.js
import router from "./router";

// 引入vuex
import store from "./store";

// vite搭建脚手架的时候做过处理了，可以在js里面直接引css
import "@/assets/css/reset.css";
import "element-plus/dist/index.css";

// 用于做md的编辑器
import VMdEditor from "@kangc/v-md-editor";
import "@kangc/v-md-editor/lib/style/base-editor.css";
import vuepressTheme from "@kangc/v-md-editor/lib/theme/vuepress.js";
import "@kangc/v-md-editor/lib/theme/style/vuepress.css";

// Prism
import Prism from "prismjs";
// highlight code
import "prismjs/components/prism-json";

// 全局添加icon组件
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// 引入element plus组件库
// import ElementPlus from "element-plus";
// 引入组件库的css文件
// import "element-plus/dist/index.css";

// const app = createApp(App);
// app.use(ElementPlus);
// app.mount("#app");

// createApp(App).use(ElementPlus).mount("#app");

VMdEditor.use(vuepressTheme, {
  Prism,
});

app.use(VMdEditor).use(router).use(store).mount("#app");
